This invention generally relates to digital data processing systems. More specifically it relates to a central processor for use in such data processing systems.
A digital data processing system comprises three basic elements: namely, a memory element, an input-output element and a processor element. The memory element stores information in addressable storage locations. This information includes data and instructions for processing the data. The processor element transfers information from the memory element. It interprets the incoming information as either data or an instruction. An instruction includes an operation code that specifies, in coded form, the operation to be performed by the processor. An instruction may also include information that specifies one or more operands. This information is called an operand specifier.
The processor element in a digital data processing system processes data in accordance with a program that comprises a number of instructions. This program is stored in the memory element. The memory element also may include other programs, known as subroutines, which perform specific functions. A program, designated a calling routine, can utilize a subroutine by incorporating a subroutine calling instruction. There are many types of calling instructions that are utilized in prior data processing systems. Generally they can be characterized as specifying a starting address for the subroutine and return information to enable the subroutine to transfer control back to the calling routine when the subroutine has been completed.
When a calling routine transfers to a subroutine, basic information must be provided or retained. For example, it is necessary to establish the environment in which the subroutine is to operate. Part of the environment for the subroutine includes addresses to be used by the subroutine for obtaining input data and for transmitting output data. Other information including trap enabling information and interruption routine information, also must be saved. Prior data processing systems normally established this environment by explicitly transferring information under the control of instructions in the subroutine.
It also is necessary to save the state of the processor when the calling routine executes the calling instruction. This includes the transfer of information in specified registers that might be used by the subroutine into memory locations and the transfer of the argument list pointer which specifies the first location in the argument list to the subroutine. In prior systems, processor state also is preserved explicitly by use of instructions in the subroutine or the calling routine or both.
Therefore a portion of the subroutine must be devoted to instructions for saving the process state and for establishing the subroutine environment. Moreover the state of the machine must also be re-established at the end of the subroutine explicitly by the use of further instructions. All of these explicit transfers are in the form of housekeeping or overhead. The requirement to include specific instructions in the subroutine to perform this overhead or housekeeping functions complicates the subroutines. Moreover it increases the number of memory locations that the subroutine requires and, as each instruction must be executed separately, contributes to the overall time that is necessary to execute a subroutine.
Therefore, it is an object of this invention to provide a calling instruction and a central processor for responding to that instruction that simplifies the transfer of operations from a calling routine to a subroutine.
Another object of this invention is to provide an instruction for transferring operations to a subroutine that automatically preserves the state of the central processor and enables that state to be restored easily.
Another object of this invention is to provide a subroutine calling instruction that automatically establishes the environment for the subroutine and re-establishes the environment for the calling routine.